﻿@{
    ViewData["Title"] = "Home Page";
}

@model TrainViewModel

<div>
    @Html.ValidationSummary()
    @*#1 - #5*@
    @using (Html.BeginForm("SearchByRoute", "Home"))
    {
        <div class="col-md-12 form-horizontal">
            <div class="form-group">
                <label class="col-md-2 control-label">Route:</label>
                <div class="col-md-10">
                    @Html.TextBoxFor(m => m.Route, new { @class = "form-control" }) 
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label"></label>
                <div class="col-md-10">
                    <button type="submit" class="btn">Submit</button>
                </div>
            </div>
        </div>

    }

    @*#6 #7*@
    @using (Html.BeginForm("SearchNumberOfTrips", "Home"))
    {
        <div class="col-md-12 form-horizontal">
            <div class="form-group">
                <label class="col-md-2 control-label">Number of Trips:</label>
                <div class="col-md-10 form-inline">
                    @Html.TextBoxFor(m => m.FromStationName, new { @class = "form-control", style = "width: 100px;" })
                    to
                    @Html.TextBoxFor(m => m.ToStationName, new { @class = "form-control", style = "width: 100px;" })
                    @Html.DropDownListFor(m => m.OperationType, new List<SelectListItem> { new SelectListItem { Text = "<", Value = "1" }, new SelectListItem { Text = "=", Value = "2" } }, new { @class = "form-control", style = "width：100px;" })
                    @Html.TextBoxFor(m => m.FilterValue, new { @class = "form-control", style = "width: 100px;", placeholder = "Stops" })                    
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label"></label>
                <div class="col-md-10">
                    <button type="submit" class="btn">Submit</button>
                </div>
            </div>
        </div>

    }

    @*#8 #9*@
    @using (Html.BeginForm("SearchShortestRoute", "Home"))
    {
        <div class="col-md-12 form-horizontal">
            <div class="form-group">
                <label class="col-md-2 control-label">Shortest Route:</label>
                <div class="col-md-10 form-inline">
                    @Html.TextBoxFor(m => m.FromStationName, new { @class = "form-control", style = "width: 100px;" })
                    to
                    @Html.TextBoxFor(m => m.ToStationName, new { @class = "form-control", style = "width: 100px;" })                                       
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label"></label>
                <div class="col-md-10">
                    <button type="submit" class="btn">Submit</button>
                </div>
            </div>
        </div>

    }

    @*#10*@
    @using (Html.BeginForm("SearchNumberOfTripWithDistance", "Home"))
    {
        <div class="col-md-12 form-horizontal">
            <div class="form-group">
                <label class="col-md-2 control-label">The Number of Different Routes:</label>
                <div class="col-md-10 form-inline">
                    @Html.TextBoxFor(m => m.FromStationName, new { @class = "form-control", style = "width: 100px;" })
                    to
                    @Html.TextBoxFor(m => m.ToStationName, new { @class = "form-control", style = "width: 100px;" })                   
                    @Html.TextBoxFor(m => m.FilterValue, new { @class = "form-control", style = "width: 100px;", placeholder = "Distance" })                    
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label"></label>
                <div class="col-md-10">
                    <button type="submit" class="btn">Submit</button>
                </div>
            </div>
        </div>

    }
</div>
<div>
    The result is: @Model.Result
</div>
